home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
NOVA - For the NeXT Workstation
/
NOVA - For the NeXT Workstation.iso
/
Apps
/
Utilities
/
Unix
/
CommandMon
/
Indicator.m
< prev
next >
Wrap
Text File
|
1992-12-26
|
722b
|
51 lines
#import "Indicator.h"
#import <dpsclient/wraps.h>
#import <appkit/Application.h>
@implementation Indicator
- initFrame:(NXRect *)frameRect
{
[super initFrame:frameRect];
on=NO;
return self;
}
- drawSelf:(NXRect *)rects :(int)count
{
if (on)
PSsetrgbcolor(1,0,0);
else
PSsetgray(NX_WHITE);
NXRectFill(&bounds);
PSsetgray(NX_BLACK);
NXFrameRect(&bounds);
return self;
}
- flash
{
void endLight ();
on=YES;
[self display];
if (timer) DPSRemoveTimedEntry(timer);
timer=DPSAddTimedEntry(.2,&endLight,self,NX_BASETHRESHOLD);
return self;
}
- turnOff
{
on=NO;
[self display];
return self;
}
void endLight (DPSTimedEntry timedEntry, double timeNow, void *data)
{
[(id)data turnOff];
}
@end